package com.android.webframework;

import java.io.IOException;
import java.io.ObjectStreamException;
import java.io.Serializable;

public final class Step implements Serializable {
	private static final long serialVersionUID = 7526471155622776147L;
	
	private String instruction;
	private double[] start;
	private double[] end;
	
	public Step() {
		instruction = "";
		start = new double[2];
		end = new double[2];
	}
	
	public Step(String instruction, double[] start, double[] end) {
		this();
		this.instruction = instruction;
		this.start = start;
		this.end = end;
	}
	
	public String instruction() {
		return instruction;
	}
	
	public double startLat() {
		return start[0];
	}
	
	public double startLon() {
		return start[1];
	}
	
	public double endLat() {
		return end[0];
	}
	
	public double endLon() {
		return end[1];
	}
	
	public String toString() {
		String s = "########## STEP OBJECT ###########";
		s += "Instruction: " + instruction;
		s += "\nStart: (" + this.startLat() + "," + this.startLon() + ")";
		s += "\nEnd: (" + this.endLat() + "," + this.endLon() + ")";
		return s;
	}
	
	private void writeObject(java.io.ObjectOutputStream out) throws IOException {
		out.defaultWriteObject();
	}
	
	private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
		in.defaultReadObject();
	}
	
	private void readObjectNoData() throws ObjectStreamException {
		//
	}
}
